C code for PEGetNthTableSessionInfo and PESetNthTableSessionInfo

If your application uses Microsoft Access database tables, you may need to examine or change session information when an Access session is to be opened. The following code is an example of how to use the PEGetNthTableSessionInfo and PESetNthTableSessionInfo functions when using Access databases.

PEGetNthTableSessionInfo

short            tableN;
    // The table number in the report
struct PESessionInfo sessionInfo;
tableN = 1;
    // The second table in the report
    // Initialize size of sessionInfo structure
sessionInfo.StructSize = PE_SIZEOF_SESSION_INFO;
if (!PEGetNthTableSessionInfo(Job, tableN, &sessionInfo)){
    // Handle error
}

PESetNthTableSessionInfo

short            tableN;
    // The table number in the report
struct PESessionInfo sessionInfo;
BOOL     propagateAcrossTables;
    // Use for all tables in report?
tableN = 0;    // The first table in the report
propagateAcrossTables = TRUE;
    // Initialize size of sessionInfo structure
sessionInfo.StructSize = PE_SIZEOF_SESSION_INFO;
sessionInfo.UserID = "user";
sessionInfo.Password = "password";
sessionInfo.SessionHandle = 0;
if (!PESetNthTableSessionInfo(Job, tableN, &sessionInfo,
propagateAcrossTables)){
    // Handle error
}


Seagate Software IMG Holdings, Inc.
http://www.seagatesoftware.com
Support services:
http://support.seagatesoftware.com